﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace FwProject.Migrations
{
    public partial class Add_PaymentInfoOfReceipt_To_fwyg : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<DateTime>(
                name: "BeginTime",
                table: "SettlementInfo",
                nullable: true);

            migrationBuilder.AddColumn<DateTime>(
                name: "EndTime",
                table: "SettlementInfo",
                nullable: true);

            migrationBuilder.CreateTable(
                name: "PaymentInfoByReceipt",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CreationTime = table.Column<DateTime>(nullable: false),
                    CreatorUserId = table.Column<long>(nullable: true),
                    LastModificationTime = table.Column<DateTime>(nullable: true),
                    LastModifierUserId = table.Column<long>(nullable: true),
                    IsDeleted = table.Column<bool>(nullable: false),
                    DeleterUserId = table.Column<long>(nullable: true),
                    DeletionTime = table.Column<DateTime>(nullable: true),
                    RestaurnatId = table.Column<Guid>(nullable: false),
                    RestaurantName = table.Column<string>(nullable: false),
                    TaskBackAmount = table.Column<decimal>(nullable: false),
                    ReceiptInfoNumber = table.Column<string>(nullable: false),
                    ReceiptInfoId = table.Column<Guid>(nullable: false),
                    PaymentInfoId = table.Column<Guid>(nullable: false),
                    ToVoid = table.Column<int>(nullable: false),
                    ToVoidTime = table.Column<DateTime>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PaymentInfoByReceipt", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "PaymentInfoByReceipt");

            migrationBuilder.DropColumn(
                name: "BeginTime",
                table: "SettlementInfo");

            migrationBuilder.DropColumn(
                name: "EndTime",
                table: "SettlementInfo");
        }
    }
}
